import { fetchUserList } from "@/services";

export default {
    namespace: 'user',
    state: {
        list: []
    },
    reducers: {
        updateList(state: any, { payload }) {
            state.list = payload
        }
    },
    effects: {
        *getList({ payload }, { call, put }) {
            const list = yield call(fetchUserList, {})
            yield put({ type: 'updateList', payload: list })
        }
    }
}